"use strict";
const tool = require("../utils/tool");
const lightAppDao = require("../dao/light_app_dao");
const request = require("request-promise-native");
const Constants = require("../config");
const mongoose = require("mongoose");

async function getUserinfo(req, res) {
  const client = tool.getResponseFunc(res);
  try {
    // orgInfo, users, data
    // const reqQuery = req.query;
    console.log(req.query);
    // const atworkParams = {orgId, domainId, clientId, clientSecret};
    // const orgInfo = {orgId, domainId};
    // const users = req.body.touser.split("|");
    if(req.query.code){
      res.json({
        "errcode":"0",
        "errmsg": "",
        "userid": req.query.code
      })
    }else{
      res.json({
        "errcode":"400",
        "errmsg": "code用户信息为空",
        "userid": ""
      })
    }
    // const atworkInstance = await tool.getAtworkInstance(atworkParams);

  } catch (e) {
    console.error(e);
  }
}

module.exports = {
  getUserinfo
}
